
public class DataStore {
   private static DataStore instance = null;
   private static int numberOfNodes=5;
   private static int maxFlitSize=10;
   private long lastPackageId=0;
   static Node[] nodes=new Node[1000];   
   
   public int getMaxFlitSize(){
	   return maxFlitSize;
   }
   
   public long getNewPackageId(){
	   lastPackageId++;
	   return lastPackageId;
   }
   
   public int getNumberOfNodes(){
	   return numberOfNodes;
   }
   
   protected DataStore() {
      // Exists only to defeat instantiation.
   }
   public static DataStore getInstance() {
      if(instance == null) {
         instance = new DataStore();
      }
      return instance;
   }
   
   public Node getNode (long id){
	   return nodes[(int) id];
   }
   
   public void addNode(Node n){
	   nodes[(int) n.getId()]=n;
   }
   
   void printNodes(){
	   for (int i=0;i<nodes.length;i++){
		   if (nodes[i]!=null){
			   System.out.print(nodes[i].getId()+";");
			   nodes[i].printVecini();
			   System.out.println();
		   }
	   }
   }
   
   public long getLastPackId(){
	   return lastPackageId;
   }
		  
}